home *** CD-ROM | disk | FTP | other *** search
/ Chip: 25 Years Anniversary / CHIP_25Jahre_Jubilaeum.iso / G DATA AddOns2 / WebShop / _SETUP.1 / sb2iclear.js < prev    next >
Text File  |  2002-01-08  |  4KB  |  107 lines

  1. <!-- sb2iclear iclear payment             -->
  2. <!-- (c) Copyright 2001 GS Software       -->
  3. <!--                                      -->
  4. <SCRIPT LANGUAGE="JavaScript">
  5.  
  6. var iok=0;
  7.  
  8. function iClearOrder()
  9. {
  10.  
  11.  
  12. var Products='';
  13. var totprice=0;
  14. for (var i = 1; i < parent.theBasket.length; i++)
  15.         {
  16.                 with(parent.theBasket[i])
  17.                 {
  18.  
  19.                 if(Attribut1=='') A1=''; else A1=', '+Attribut1;
  20.                 if(Attribut2=='') A2=''; else A2=', '+Attribut2;
  21.                 if(Attribut3=='') A3=''; else A3=', '+Attribut3;
  22.                 if(Textin!='') Txt=', '+Textin; else Txt='';
  23.  
  24.     theitem=Item.substr(Item.indexOf(" ")+1,Item.length-Item.indexOf(" ")-1)+A1+A2+A3+Txt+'::'+Item.substr(0,Item.indexOf(" "));
  25.  
  26.                         thequantity =Quantity;
  27.                         itemtotal = 0;
  28.  
  29.                         if ((parseFloat(Price2)>0) && (parseInt(Quantity) >= parseInt(Quantity2)))
  30.                                 theprice=Price2
  31.                         else
  32.                                 if ((parseFloat(Price1)>0) && (parseInt(Quantity) >= parseInt(Quantity1)))
  33.                                         theprice=Price1
  34.                                 else
  35.                                         theprice = Price;
  36.  
  37.                         itemtotal = (eval(theprice*thequantity));
  38.                         temptotal = itemtotal * 100;
  39.                         totprice = totprice + itemtotal;
  40.  
  41.                         thisvat = (parseFloat(theprice*productvatrate)) / (parseFloat(productvatrate)+parseFloat(100));
  42.                         thisvat = parseFloat(parent.alterError(thisvat));
  43.                         
  44.  
  45.  Products=Products+theitem+'::'+thequantity+'::'+parent.alterError(theprice-thisvat)+'::'+parent.alterError(theprice)+'::'+productvatrate+':::'
  46.  
  47.                 }
  48.         }
  49.  
  50.  
  51.         var postage=0;
  52.         getdataiclear();
  53.  
  54.         var postage=parseFloat(parent.myshipmentvalue);
  55.  
  56.  
  57.         var discount=0;
  58.  
  59.         if ((totprice>={DisAmount1})&({DisCount1} != 0))
  60.                 discount={Discount1};
  61.  
  62.         if((totprice>={DisAmount2})&({DisCount2}!=0))
  63.                 discount={Discount2};
  64.  
  65.         var discountamount=totprice*discount/100;
  66.         var discountprice=totprice-discountamount;
  67.  
  68.         if ((discountprice>={PAmount1})&({PAmount1}!=0))
  69.                 postage={Postage1};
  70.  
  71.         if ((discountprice>={PAmount2})&({PAmount2}!=0))
  72.                 postage={Postage2};
  73.  
  74.         var finalprice=discountprice+postage;
  75.         var itemc=0;
  76.  
  77.         if (discount>0)
  78. {
  79. //        Products=Products+'Rabatt::0000::1::-'+parent.alterError(parent.alterError(discountamount*100/({VATRATE}+100)))+'::-'+parent.alterError(discountamount)+'::{VATRATE}:::';
  80.         Products=Products+'Rabatt::0000::1::-'+parent.alterError(parent.alterError(discountamount*100/({VATRATE}+100)))+'::-'+parent.alterError(discountamount)+'::{VATRATE}:::';
  81.  
  82.         itemc++;
  83. }
  84.         if (postage>0)
  85. {
  86.  
  87.                 var datum = new Date();
  88.  
  89.                 var bid = String(datum.getTime()).substr(1,10);
  90.  
  91.  
  92.         Products=Products+'Versandkosten '+parent.myshipmenttext+'::0000::1::'+parent.alterError(parent.alterError(postage*100/({VATRATE}+100)))+'::'+parent.alterError(postage)+'::{VATRATE}:::';
  93.         itemc++;
  94. }
  95.  
  96.          var AMNT = document.forms["orderform"].Rechnungsbetrag.value;
  97.          var CURR = "EUR"; 
  98.  
  99. var ad='http://www.iclear.de/servlets/BuyToolGS?ShopID={iclearshopid}&BasketID='+bid+'&Currency='+CURR+'&ProductIndex='+parseInt(parent.alterError(parent.theBasket.length-1+itemc))+'&Products='+Products;
  100. //alert(ad);
  101. document.location.href=ad;
  102.  
  103. };
  104.  
  105.  
  106.  
  107. </SCRIPT>